#include<stdio.h>
#include<string.h>
#include<math.h>
int main(){
int n,t,m;
char a[105];
scanf("%d",&n);
while(n--){
int maxn=0,minn=100;
int b[200]={0};
int x=0;
scanf("%s",a);
t=strlen(a);
for(int i=0;i<t;i++){
m=a[i];
b[m]++;
if(b[m]>maxn){
maxn=b[m];
}
}
for(int i=0;i<=200;i++){
if(b[i]>=1&&b[i]<minn){
minn=b[i];
x=1;
}
}
if(x==0){
minn=0;
}
m=maxn-minn;
int p=0;
if(m==0||m==1){
p=1;
}
for(int i=2;i<=sqrt(m);i++){
if(m%i==0){
p=1;
break;
}
}
if(p==0){
printf("Lucky Word\n");
printf("%d\n",m);
}else{printf("No Answer\n0\n");}
}
return 0;
}
